package com.knowledgepoint.study.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.knowledgepoint.study.mapper.ArticleMapper;
import com.knowledgepoint.study.model.entity.Article;
import com.knowledgepoint.study.service.ArticleService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 文章服务实现类
 */
@Service
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements ArticleService {

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean physicalDeleteById(Long id) {
        return baseMapper.physicalDeleteById(id) > 0;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean physicalDeleteBatchIds(List<Long> ids) {
        return baseMapper.physicalDeleteBatchIds(ids) > 0;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean physicalDeleteByMap(Map<String, Object> columnMap) {
        return baseMapper.physicalDeleteByMap(columnMap) > 0;
    }
}
